package santiago.ressources.utils;

import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import santiago.view.ResourceManager;

public enum ImageManager {

    Desert("case-desert.png"),
    Gameboard("plateau.png"),
    Palmtree("palmier.png"),
    Spring("source.png");
    private String FileName;

    private ImageManager(String FileName) {
        this.FileName = FileName;
    }

    @Override
    public String toString() {
        return FileName;
    }

    public BufferedImage getBufferedImage() {
        try {
            return ImageIO.read(getClass().getResourceAsStream(ResourceManager.FilePath + FileName));
        } catch (IOException ex) {
            Logger.getLogger(ResourceManager.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
}
